package com.duoduo.selenium.util;

public class SeleniumUtil {

	/**
	 * 获取当前项目路径，路径以"/"结尾，如：C:/a/b/c/
	 * @return
	 */
	public static String getBaseDir() {
		String baseDir = System.getProperty("user.dir", "").replaceAll("\\\\", "/");
		return baseDir.endsWith("/") ? baseDir : (baseDir + "/");
	}

	/**
	 * 设置Selenium的属性
	 */
	public static void setProperties() {
		System.setProperty("webdriver.gecko.driver", getBaseDir() + "drivers/geckodriver.exe");
		// System.setProperty("webdriver.firefox.bin", "D:/Program Files/Mozilla Firefox/firefox.exe");
	}

	public static void waitme(long ms) {
		try {
			Thread.sleep(ms);
		} catch (Exception e) {
		}
	}
}
